<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script src="./ajax.js"></script>
<script>

  ajax({
    url:"http://10.11.55.86:3000/login",
    data:{
      username:"admin",
      password:123456
    },
  }).then(res=>{
    res = JSON.parse(res).data;
    console.log(res)
    localStorage.setItem("token", res.token)

    return ajax({
      url:"http://10.11.55.86:3000/getuser",
      data:{
        token: res.token
      }
    })

  }).then((res)=>{
    res = JSON.parse(res).data;
    console.log(res)
    let uId;
    res.some(val=>{
      uId = val.uId
      return val.uName === "石红娟";
    })

    return ajax({
      url:"http://10.11.55.86:3000/getuser",
      data:{
        token: localStorage.getItem("token"),
        uId
      }
    })

  }).then(res=>{
    res = JSON.parse(res);
    console.log(res)
  })

  
</script>
</html>